package io.renren.modules.sell.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import io.renren.modules.sell.dao.ProductCategoryDao;
import io.renren.modules.sell.entity.ProductCategory;
import io.renren.modules.sell.service.ProducetCategoryService;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * @ClassName ProductCategoryImpl
 * @Author mengjiafeng
 * @Date 2020/4/11 14:22
 **/
@Service
public class ProductCategoryImpl extends ServiceImpl<ProductCategoryDao, ProductCategory> implements ProducetCategoryService {
    @Override
    public List<ProductCategory> findByCategoryTypeIn(List<Integer> list) {
        return null;
    }

    @Override
    public List<ProductCategory> listBysellerId(Long sellerId) {
        List<ProductCategory> categoryList = this.list(new QueryWrapper<ProductCategory>().eq("seller_id", sellerId));

        return categoryList;
    }

    @Override
    public void deleteBatch(Integer[] categoryIds) {
        this.removeByIds(Arrays.asList(categoryIds));
    }
}
